package com.isias.system.Controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.isias.common.result.Result;
import com.isias.model.system.SysLoginLog;
import com.isias.model.vo.SysLoginLogQueryVo;
import com.isias.system.Service.LoginLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/system/loginlog")
public class LoginLogController {
    @Autowired
    private LoginLogService loginLogService;

    @GetMapping("{page}/{limit}")
    public Result index(@PathVariable Long page, @PathVariable Long limit, SysLoginLogQueryVo sysLoginLogQueryVo) {
        Page<SysLoginLog> pageParam = new Page<>(page, limit);
        IPage<SysLoginLog> pageModel = loginLogService.selectPage(pageParam, sysLoginLogQueryVo);
        return Result.ok(pageModel);
    }


//    @GetMapping("{id}")
//    public Result get(@PathVariable Long id) {
//        SysLoginLog sysLoginLog = loginLogService.getById(id);
//        return Result.ok(sysLoginLog);
//    }

}
